package java_DesignPattern.StructuralPattern.CompositePattern;

/**
 * 菜单组件类
 */
public abstract class MenuCompoment {

    private String name;
    protected int level;

    /**
     * 构建菜单组件
     * @param name
     * @param level
     */
    public MenuCompoment(String name, int level) {
        this.name = name;
        this.level = level;
    }

    public void add(MenuCompoment menuCompoment) {
        throw new UnsupportedOperationException();
    }

    public void remove(MenuCompoment menuCompoment) {
        throw new UnsupportedOperationException();
    }

    public MenuCompoment getIndex(int i) {
        throw new UnsupportedOperationException();
    }

    public String getName() {
        return name;
    }

    public abstract void print();
}
